<template>
  <basic-form
    ref="moduleForm"
    v-model="moduleForm"
    :rules="moduleRule"
    primary-key="moduleId"
    form-type="dialog"
    :query-api="module_queryByIdApi"
    :insert-api="module_insertApi"
    :update-api="module_updateApi"
  >
    <a-form-model-item label="模块名称" prop="moduleName" :hasFeedback="true">
      <a-input v-model="moduleForm.moduleName" placeholder="请输入模块名称" />
    </a-form-model-item>
    <a-form-model-item label="模块路径" prop="path">
      <a-input v-model="moduleForm.path" placeholder="请输入模块路径" :hasFeedback="true" />
    </a-form-model-item>
    <a-form-model-item label="模块包名" prop="package">
      <a-input v-model="moduleForm.package" placeholder="请输入模块包名" :hasFeedback="true" />
    </a-form-model-item>
    <a-form-model-item label="排序" prop="sortNo">
      <a-input v-model.number="moduleForm.sortNo" placeholder="请输入排序" :hasFeedback="true" />
    </a-form-model-item>
    <a-form-model-item label="模块描述" prop="description">
      <a-input
        type="textarea"
        v-model="moduleForm.description"
        placeholder="请输入模块描述"
        :hasFeedback="true"
      />
    </a-form-model-item>
  </basic-form>
</template>
<script>
import {
  module_queryByIdApi,
  module_insertApi,
  module_updateApi
} from "@/api/org/module";
import { moduleRule } from "@/profile/org/module";
export default {
  props: {
    moduleId: {
      type: [String, Object]
    }
  },
  data() {
    return {
      module_queryByIdApi,
      module_insertApi,
      module_updateApi,
      moduleForm: {
        moduleId: this.moduleId
      },
      moduleRule
    };
  }
};
</script>